package com.ruoyi.system.service.impl;

import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.Major;
import com.ruoyi.system.domain.SysPost;
import com.ruoyi.system.mapper.MajorMapper;
import com.ruoyi.system.mapper.MajorMapper1;
import com.ruoyi.system.service.IMajorService;
import com.ruoyi.system.service.IMajorService1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * MajorService class provides methods to perform CRUD operations on Major entity.
 * @author rayfoo
 */
@Service
public class MajorServicelmpl1 implements IMajorService1 {

    @Autowired
    private MajorMapper1 majorMapper;

    @Override
    public List<Major> selectPostList(Major major) {

        return majorMapper.selectPostList(major);
    }

    @Override
    public Major selectPostById(Long id) {
        return majorMapper.selectPostById(id);
    }

    @Override
    public boolean checkPostNameUnique(Major major) {

        return majorMapper.checkPostNameUnique(major) == 0;
    }

    @Override
    public boolean checkPostCodeUnique(Major major) {

        return majorMapper.checkPostCodeUnique(major) == 0;
    }

    @Override
    public int insertPost(Major major) {

        return majorMapper.insertPost(major);
    }


}
